{# SPDX-License-Identifier: Apache-2.0 -#}

{% extends "admin/base.html" %}

{% block title %}Bulk Project Name Prohibition{% endblock %}

{% block content %}
<div class="card card-danger">
  <div class="card-header">
    <h3 class="card-title">Prohibit project name</h3>
  </div>
  <div class="card-body">
    <p>
    Project names separated by whitespace. <b>Note: There is no confirmation step!</b>
    </p>
  </div>

  <form method="POST" action="{{ request.route_path('admin.prohibited_project_names.bulk_add') }}">
    <input name="csrf_token" type="hidden" value="{{ request.session.get_csrf_token() }}">
    <div class="card-body">
      <div class="form-group">
        <label for="prohibitedProjectName">Project name(s)</label>
        <textarea name="projects" class="form-control" id="prohibitedProjectName" rows="20" placeholder="Enter project name(s) to prohibit " {{ "disabled" if not request.has_permission(Permissions.AdminProhibitedProjectsWrite) }} autocomplete="off" autocorrect="off" autocapitalize="off"></textarea>
      </div>

      <div class="form-group">
        <label for="prohibitedComment">Comment</label>
        <textarea name="comment" class="form-control" id="prohibitedComment" rows="3" placeholder="Enter comment ..." {{ "disabled" if not request.has_permission(Permissions.AdminProhibitedProjectsWrite) }}></textarea>
      </div>
    </div>

    <div class="card-footer">
      <div class="float-right">
        <button type="submit" class="btn btn-danger" title="{{ 'Submitting requires superuser privileges' if not request.has_permission(Permissions.AdminProhibitedProjectsWrite) }}" {{ "disabled" if not request.has_permission(Permissions.AdminProhibitedProjectsWrite) }}>Submit</button>
      </div>
    </div>
  </form>
</div>
{% endblock %}
